package com.ly.gof.structure.composite.safe;

/**
 * @author liuyang
 * @des
 * @Version 1.0
 * @Date: 28/07/2021 16:27
 */
public class CompositePatternSafe {
    public static void main(String[] args) {
        CompositeSafe c0 = new CompositeSafe();
        CompositeSafe c1 = new CompositeSafe();
        ComponentSafe leaf1 = new LeafSafe("1");
        ComponentSafe leaf2 = new LeafSafe("2");
        ComponentSafe leaf3 = new LeafSafe("3");
        c0.add(leaf1);
        c0.add(c1);
        c1.add(leaf2);
        c1.add(leaf3);
        c0.operation();
    }
}
